import {
	HTTP_REQUEST_URL
} from "@/config/app.js";
import {
	http
} from "@/utils/http.js";
var Hhost = `https://app.jichacha.vip`;
// 发送验证码
export function setVerify(data) {
	return http.post(HTTP_REQUEST_URL+"/api/verify", data, {
		custom: {
			auth: false,
		},
	});
}

// 注销账号
export function deletedUser(data) {
	return http.post(HTTP_REQUEST_URL+"/api/user/deleted", data, {
		custom: {
			auth: true,
		},
	});
}

// 注册账号
export function setMobile(data) {
	return http.post(HTTP_REQUEST_URL+"/api/mobile", data, {
		custom: {
			auth: false,
		},
	});
}

// 找回密码
export function seekPassword(data) {
	return http.post(HTTP_REQUEST_URL+"/api/seek_password", data, {
		custom: {
			auth: false,
		},
	});
}

// 绑定手机号
export function bindingPhone(data) {
	return http.post(HTTP_REQUEST_URL+"/api/binding_phone", data, {
		custom: {
			auth: true,
		},
	});
}

// 快捷微信登录
export function wechatLogin(data) {
	return http.post(HTTP_REQUEST_URL+"/api/wechat_login", data, {
		custom: {
			auth: false,
		},
	});
}

// 快捷苹果登录
export function appleLogin(data) {
	return http.post(HTTP_REQUEST_URL+"/api/apple_login", data, {
		custom: {
			auth: false,
		},
	});
}

// 账号密码登录
export function userLogin(data) {
	return http.post(HTTP_REQUEST_URL+"/api/login", data, {
		custom: {
			auth: false,
		},
	});
}

// 获取各类协议
export function getTreaty(data) {
	return http.get(HTTP_REQUEST_URL+"/api/get_treaty", {
		params: data,
		custom: {
			auth: false,
		},
	});
}

// 评分规则说明
export function getScore(data) {
	return http.get(HTTP_REQUEST_URL+"/api/get_score", {
		params: data,
		custom: {
			auth: false,
		},
	});
}

// 收藏列表
export function favoriteList(data) {
	return http.get(HTTP_REQUEST_URL+"/api/favorite_list", {
		params: data,
		custom: {
			auth: true,
		},
	});
}

// 收藏、取消收藏商品
export function setFavorite(data) {
	return http.post(HTTP_REQUEST_URL+"/api/favorite", data, {
		custom: {
			auth: true,
		},
	});
}

// 增加历史记录
export function setHistory(data) {
	return http.post(HTTP_REQUEST_URL+"/api/history", data, {
		custom: {
			auth: true,
		},
	});
}

// 补充商品配料
export function setRestockItem(data) {
	return http.post(HTTP_REQUEST_URL+"/api/restock_item", data, {
		custom: {
			auth: true,
		},
	});
}

// 历史记录列表
export function historyList(data) {
	return http.get(HTTP_REQUEST_URL+"/api/history_list", {
		params: data,
		custom: {
			auth: true,
		},
	});
}
// 删除历史记录
export function delHistoryList(id, data) {
	return http.delete(HTTP_REQUEST_URL+"/api/history/" + id, data, {
		custom: {
			auth: true,
		},
	});
}

// 删除历史记录
export function delHistoryListOne(data) {
	return http.post(HTTP_REQUEST_URL+"/api/history_del", data, {
		custom: {
			auth: true,
		},
	});
}

// 商品列表
export function getGoodsList(data) {
	return http.get(HTTP_REQUEST_URL+"/api/goods", {
		params: data,
		custom: {
			auth: true,
		},
	});
}

// 添加剂详情信息
export function goodsItemDetail(data) {
	return http.get(HTTP_REQUEST_URL+"/api/goods_item_detail", {
		params: data,
		custom: {
			auth: true,
		},
	});
}

// 食品无结果申报、纠错申报
export function setFeedback(data) {
	return http.post(HTTP_REQUEST_URL+"/api/feedback", data, {
		custom: {
			auth: true,
		},
	});
}

// 商品详情页
export function getGoodsDetail(data) {
	return http.get(HTTP_REQUEST_URL+"/api/goods_detail", {
		params: data,
		custom: {
			auth: true,
		},
	});
}

// 商品等级信息
export function getGoodsGrade() {
	return http.get(HTTP_REQUEST_URL+"/api/grade_info", {
		custom: {
			auth: true,
		},
	});
}

// 分享结果页
export function getGoodsShare(data) {
	return http.get(HTTP_REQUEST_URL+"/api/goods_share", {
		params: data,
		custom: {
			auth: false,
		},
	});
}

// 食品码扫条码结果
export function scanningDetail(data) {
	return http.post(HTTP_REQUEST_URL+"/api/scanning_detail", data, {
		custom: {
			auth: true,
		},
	});
}

// 扫配料表结果
export function analysisDetail(data) {
	return http.post(HTTP_REQUEST_URL+"/api/analysis_detail", data, {
		custom: {
			auth: true,
		},
	});
}
// 补充商品营养成分
export function nutritionItem(data) {
	return http.post(HTTP_REQUEST_URL+"/api/nutrition_item", data, {
		custom: {
			auth: true,
		},
	});
}
// app版本检测
export function appVersion(data) {
	return http.get(HTTP_REQUEST_URL+"/api/app_version", {
		params: data,
		custom: {
			auth: true,
		},
	});
}

// 图片上传
export function uploadImage(data) {
	return http.post(HTTP_REQUEST_URL+"/api/upload", data);
}

// 检查token是否有效
export function getCheck(data) {
	return http.get(HTTP_REQUEST_URL+"/api/check", {
		params: data,
		custom: {
			auth: true,
		},
	});
}
// 获取用户资料
export function getUserInfo(data) {
	return http.get(HTTP_REQUEST_URL+"/api/user/info", {
		params: data,
		custom: {
			auth: true,
		},
	});
}

// 更新用户资料
export function setUserInfo(data) {
	return http.post(HTTP_REQUEST_URL+"/api/user/update", data, {
		custom: {
			auth: true,
		},
	});
}

// 商品反馈 - 可选的分类列表
export function getFeedBackCate(data) {
	return http.get(HTTP_REQUEST_URL+"/api/feedback_cate", {
		params: data,
		custom: {
			auth: true,
		},
	});
}

// 用户余额
export function getUserMoneyMoney(data) {
	return http.get(HTTP_REQUEST_URL+"/api/user/money/money", {
		params: data,
		custom: {
			auth: true,
		},
	});
}

// 红包记录
export function getUserMoneyBalance(data) {
	return http.get(HTTP_REQUEST_URL+"/api/user/money/balance", {
		params: data,
		custom: {
			auth: true,
		},
	});
}

// 提现记录
export function getUserMoneyExtract(data) {
	return http.get(HTTP_REQUEST_URL+"/api/user/money/extract", {
		params: data,
		custom: {
			auth: true,
		},
	});
}

// 申请提现
export function setUserExtractCash(data) {
	return http.post(HTTP_REQUEST_URL+"/api/user/extract/cash", data, {
		custom: {
			auth: true,
		},
	});
}
// 申请提现
export function setQQLogin(data) {
	return http.post(HTTP_REQUEST_URL+"/api/qq_login", data, {
		custom: {
			auth: false,
		},
	});
}

// 红包视频
export function getMoneyVideo(data) {
	return http.get(HTTP_REQUEST_URL+"/api/user/money/video", {
		params: data,
		custom: {
			auth: true,
		},
	});
}

// app审核状态
export function getCheckAppStatus() {
	return http.get(HTTP_REQUEST_URL+"/api/check_app_status", {
		custom: {
			auth: false,
		},
	});
}

// 商品锁定数量
export function getHistoryLocked(data) {
	return http.get(HTTP_REQUEST_URL+"/api/history_locked", {
		params: data,
		custom: {
			auth: true,
		},
	});
}

// 用户查看锁定商品
export function setHistoryLook(data) {
	return http.post(HTTP_REQUEST_URL+"/api/history_look", data, {
		custom: {
			auth: true,
		},
	});
}

// app是否节流
export function check_search_status() {
	return http.get(HTTP_REQUEST_URL+"/api/check_search_status", {
		custom: {
			auth: false,
		},
	});
}

// app基本数据
export function app_info() {
	return http.get(HTTP_REQUEST_URL+"/api/app_data", {
		custom: {
			auth: false,
		},
	});
}

// app是否节流
export function get_contact() {
	return http.get(HTTP_REQUEST_URL+"/api/get_contact", {
		custom: {
			auth: false,
		},
	});
}

// 加载页广告
export function load_adv_status() {
	return http.get(HTTP_REQUEST_URL+"/api/load_adv_status", {
		custom: {
			auth: false,
		},
	});
}

// 结果页广告
export function res_adv_status() {
	return http.get(HTTP_REQUEST_URL+"/api/res_adv_status", {
		custom: {
			auth: false,
		},
	});
}

// 验证码信息
export function create_yzm_data() {
	return http.get(HTTP_REQUEST_URL+"/api/create_yzm_data", {
		custom: {
			auth: true,
		},
	});
}

// 图片信息
export function get_yzm_image(data) {
	return http.get(HTTP_REQUEST_URL+"/api/get_yzm_image", {
		params: data,
		custom: {
			auth: true,
		},
	});
}

// 图片验证   x:
export function check_yzm_data(data) {
	return http.get(HTTP_REQUEST_URL+"/api/check_yzm_data", {
		params: data,
		custom: {
			auth: true,
		},
	});
}

// openSHOP 
export function openShop(data) {
	return http.post(HTTP_REQUEST_URL+"/api/open_webshop", data,{
		custom: {
			auth: true,
		},
	});
}

// linkSHOP  
export function linkShop(data) {
	return http.post(HTTP_REQUEST_URL+"/api/link_webshop", data,{
		custom: {
			auth: true,
		},
	});
}

// closeSHOP  
export function closeShop(data) {
	return http.post(HTTP_REQUEST_URL+"/api/close_webshop", data,{
		custom: {
			auth: true,
		},
	});
}

///user/money/reward
export function reward(data) {
	return http.post(HTTP_REQUEST_URL+"/api/user/money/reward", data,{
		custom: {
			auth: true,
		},
	});
}